import React, { Component } from 'react';
import { Card, Tabs } from 'antd'
import '../../assets/css/login.css'
import PasswdForm from './PasswdForm';
import MobileForm from './MobileForm';
class Index extends Component {
    constructor(props) {
        super(props)
        const jwt = sessionStorage.getItem("jwt")
        if (jwt) {
            // 已经登录，则去后台首页
            this.props.history.push("/dashboard")
        }
    }
    render() {
        const { TabPane } = Tabs
        return (
            <div id='container'>
                <Card id='cardStyle'>
                    <Tabs defaultActiveKey="1" centered>
                        <TabPane tab="密码登录" key="1" tabBarGutter={300}>
                            <PasswdForm />
                        </TabPane>
                        <TabPane tab="短信登录" key="2">
                            <MobileForm />
                        </TabPane>
                    </Tabs>
                </Card>,
            </div >
        );
    }

}

export default Index;

